<script setup>
import { toRefs } from 'vue';
import useStore from '../store';

const { todos } = useStore()
const { list, leftCount, clearDone, filterArr, active, changeActive } = toRefs(todos)
</script>

<template>
  <footer class="footer">
    <span class="todo-count"><strong>{{ leftCount }}</strong> item left</span>
    <ul class="filters">
      <li v-for="item in filterArr" :key="item" @click="changeActive(item)">
        <a :class="{ selected: item === active }">{{ item }}</a>
      </li>
    </ul>
    <button class="clear-completed" @click="clearDone">Clear completed</button>
  </footer>
</template>

<style lang="less" scoped>
</style>
